package com.yanyu.space.sys.listener.xxljob;


import com.yanyu.space.common.core.annotation.XxlJob;
import com.yanyu.space.common.xxljob.context.XxlJobHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author yanyu
 */
@Component
@Slf4j
public class XxljobWorker {

    @XxlJob("space-xxljob-demo")
    public String demoJobHandler() {
//        log.info("XXL-JOB, Hello World.{}", XxlJobHelper.getJobParam());
        // 打印日志到xxljob自己配置的文件中
        XxlJobHelper.log("XXL-JOB, Hello Worldff.{}", XxlJobHelper.getJobParam() );
        // 日志发送到xxljob控制台
        XxlJobHelper.handleResult(200, "SUCCESSGGGG");
        return "SUCCESSGZ";
    }
}
